const baseUrl = 'http://b.anshujiaoyu.com'
let listCount = 5;
const loadingTime = 500;
const showLog = false;
const http_request = (url="",data={},type='GET',header={})=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			method:type,
			url:baseUrl+url,
			data:data,
			header:header,
			dataType:'json',
		}).then((response)=>{
			setTimeout(function(){
				uni.hideLoading();
			},1000);
			let [error,res] = response;
			resolve(res.data);
		}).catch(error=>{
			let [err,res] = error;
			reject(err)
		})
	});	
}
export default http_request